package com.design.model;

import java.util.ArrayList;
import java.util.List;

/**
 * def
 *
 * @author lw
 * @date 2023/12/4 15:42
 **/
public class ConcreteCollection<T> implements IterableCollection<T> {
    private List<T> items = new ArrayList<>();

    public void addItem(T item) {
        items.add(item);
    }

    @Override
    public Iterator<T> createIterator() {
        return new ConcreteIterator<>(items);
    }
}
